#ifndef ENUMERATION_H
#define ENUMERATION_H

#include "valuetype.h"

#include <QtCore/QSet>

namespace core
{

typedef QString EnumerationName;
typedef QSet<QString> EnumerationValues;

class Enumeration : public ValueType
{
public:
    Enumeration();
    Enumeration(const EnumerationName& name,
        const EnumerationValues& values);
    Enumeration(const Enumeration& other);
    ~Enumeration();

    QString name() const;
    bool matches(const TypeName& name) const;
    bool matches(const Type& type) const;

    void setValue(const QVariant& value);
    QVariant getValue() const;

    bool operator ==(const Type& type) const;
    bool operator !=(const Type& type) const;

    bool canConvert(const TypeValue& value) const;
    ValueKeywordMask keywordMask() const;

    bool hasIdentity() const;
    void setIdentity(const Type& identity);

    Type* copy() const;

public:
    static const TypeName NAME;
    static const TypeValue INVALID;

private:
    EnumerationName m_name;
    TypeValue m_value;
    QSet<QString> m_values;
};

} // namespace core

#endif
